﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using QLKhachSan.DTO;
using System.Data;
using System.Data.SqlClient;

namespace QLKhachSan.DAO
{
    public class DAO_LoaiPhong
    {
        public static void themLoaiPhong(DTO_LoaiPhong p)
        {
            string[] name = new string[1] { "@TenLP" };
            object[] ob = new object[1] { p.TenLP};
            clsKetNoi.ThucThiLenhCoTS("pr_ThemLoaiPhong", name, ob, 1);           
        }
        public static DataTable hienthiDanhSachLoaiPhong()
        {
            return clsKetNoi.Load("pr_HienThiLoaiPhong");
        }
        public static void suaLoaiPhong(DTO_LoaiPhong p)
        {
            string[] name = new string[2] { "@MaLP", "@TenLP" };
            object[] ob = new object[2] { p.MaLP, p.TenLP };
            clsKetNoi.ThucThiLenhCoTS("pr_SuaLoaiPhong", name, ob, 2);
        }
        public static void xoaLoaiPhong(DTO_LoaiPhong p)
        {
            string[] name = new string[1] { "@MaLP" };
            object[] ob = new object[1] { p.MaLP };
            clsKetNoi.ThucThiLenhCoTS("pr_XoaLoaiPhong", name, ob, 1);
        }

    }
}
